import util from "@/libs/util";
import cookiesClear from "@/libs/cookies-clear";

export default {
  namespaced: true,
  actions: {
    async commonInit({ dispatch }) {
      cookiesClear();
      util.title();
      localStorage.clear();
      await dispatch("d2admin/db/databaseClear", {}, { root: true });
      await dispatch("d2admin/page/closeAll", null, { root: true });
      await dispatch("d2admin/menu/menuSet", [], { root: true });
      await dispatch("d2admin/router/set", [], { root: true });
    },
  },
};
